import { ElMessage } from 'element-plus'

function success(text = '操作成功', close = true) {

  ElMessage.success({
    message: text,
    type: 'success',
    showClose: close
  })
}
function warning(text = '警告', close = true) {
  ElMessage.warning({
    message: text,
    type: 'warning',
    showClose: close
  })
}

function error(text: string, close = true) {
  ElMessage.error({
    message: text,
    type: 'error',
    showClose: close
  })
}

function info(text: string, close = true) {
  ElMessage.info({
    message: text,
    type: 'info',
    showClose: close
  })
}
export default {
  success,
  warning,
  error,
  info,
}

